class Solution(object):
    def findMinArrowShots(self, points):
        if not points:
            return 0
        
        arrows=1
        points.sort(key=lambda x:x[1])
        target=points[0][1]
        for i in points:
            if i[0]>target:
                target=i[1]
                arrows+=1
        return arrows
x=Solution()
arr=[[10,16],[2,8],[1,6],[7,12]]
print(x.findMinArrowShots(arr))